<div class="d-flex justify-content-center">
  <div class="col-8">
    @if (label(); as labelRef) {
      <div>
        <h2 data-cy="labelDetailsHeading"><span jhiTranslate="jhipsterSampleApplicationApp.label.detail.title">Label</span></h2>

        <hr />

        <jhi-alert-error />

        <jhi-alert />

        <dl class="row-md jh-entity-details">
          <dt><span jhiTranslate="global.field.id">ID</span></dt>
          <dd>
            <span>{{ labelRef.id }}</span>
          </dd>
          <dt><span jhiTranslate="jhipsterSampleApplicationApp.label.label">Label</span></dt>
          <dd>
            <span>{{ labelRef.label }}</span>
          </dd>
          <dt><span jhiTranslate="jhipsterSampleApplicationApp.label.operation">Operation</span></dt>
          <dd>
            @for (operation of labelRef.operations; track $index; let last = $last) {
              <span>
                <a [routerLink]="['/operation', operation.id, 'view']">{{ operation?.id }}</a
                >{{ last ? '' : ', ' }}
              </span>
            }
          </dd>
        </dl>

        <button type="submit" (click)="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
          <fa-icon icon="arrow-left" />&nbsp;<span jhiTranslate="entity.action.back">Back</span>
        </button>

        <button type="button" [routerLink]="['/label', labelRef.id, 'edit']" class="btn btn-primary">
          <fa-icon icon="pencil-alt" />&nbsp;<span jhiTranslate="entity.action.edit">Edit</span>
        </button>
      </div>
    }
  </div>
</div>
